<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>文档管理</title>
    {include file="/admin/head"/}
    <style>
        .son td{
            padding-left: 25px;
        }
        .son-son td{
            padding-left: 50px;
        }
    </style>
</head>
<body leftmargin="8" topmargin="8" background='/static/images/allbg.gif'>
<div class="x-nav">
        <span class="layui-breadcrumb">
          <a href="">首页</a>
          <a href="">演示</a>
          <a>
            <cite>导航元素</cite></a>
        </span>
    <a class="layui-btn layui-btn-primary layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:38px">ဂ</i></a>
</div>
<div class="x-body">
    <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so">

        </form>
    </div>
    <xblock>
        <button class="layui-btn" onclick="x_admin_show('添加导航','/admin/nav/info?id=0&lang={$lang}')">
            <i class="layui-icon"></i>添加
        </button>
    </xblock>
    <table class="layui-table">
        <thead>
        <tr>
            <th>导航名称</th>
            <th>连接地址</th>
            <th>类型</th>
            <th>列表模板</th>
            <th>详情模板</th>
            <th>是否显示</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {volist name="list" id="value"}
        <tr>
            <td>{$value.name}({$value.son_count})</td>
            <td>{$value.url}</td>
            <td>{$value.web_type_text}</td>
            <td>{$value.list_template}</td>
            <td>{$value.info_template}</td>
            <td>{$value.isshow_text}</td>
            <td class="td-manage">
                <a title="修改"  onclick="x_admin_show('编辑','/admin/nav/info?id={$value.id}&lang={$lang}')" href="javascript:;">
                   修改
                </a>
                <a href="/index?path={$value.url}" target="_blank">
                    查看
                </a>
                <a title="删除" onclick="member_del(this,'{$value.id}')" href="javascript:;">
                    删除
                </a>
            </td>
        </tr>
        {volist name="value.son" id="item"}
        <tr class="son">
            <td>{$item.name}({$item.son_count})</td>
            <td>{$item.url}</td>
            <td>{$item.web_type_text}</td>
            <td>{$item.list_template}</td>
            <td>{$item.info_template}</td>
            <td>{$item.isshow_text}</td>
            <td class="td-manage">
                <a title="修改"  onclick="x_admin_show('编辑','/admin/nav/info?id={$item.id}&lang={$lang}')" href="javascript:;">
                    修改
                </a>
                <a href="/index?path={$item.url}" target="_blank">
                    查看
                </a>
                <a title="删除" onclick="member_del(this,'{$item.id}')" href="javascript:;">
                    删除
                </a>
            </td>
        </tr>
        {volist name="item.son" id="message"}
        <tr class="son">
            <td>{$message.name}</td>
            <td>{$message.url}</td>
            <td>{$message.web_type_text}</td>
            <td>{$message.list_template}</td>
            <td>{$message.info_template}</td>
            <td>{$message.isshow_text}</td>
            <td class="td-manage">
                <a title="修改"  onclick="x_admin_show('编辑','/admin/nav/info?id={$message.id}&lang={$lang}')" href="javascript:;">
                    修改
                </a>
                <a href="/index?path={$message.url}" target="_blank">
                    查看
                </a>
                <a title="删除" onclick="member_del(this,'{$message.id}')" href="javascript:;">
                    删除
                </a>
            </td>
        </tr>
        {/volist}
        {/volist}
        {/volist}
        </tbody>
    </table>
</div>
<script>
    /*删除*/
    function member_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            //发异步删除数据
            $(obj).parents("tr").remove();
            post('/sys/nav/delete?id=' + id,{},'message');
            layer.msg('已删除!',{icon:1,time:1000});
        });
    }
    function message(){
        location.reload();
    }
</script>
</body>
</html>